package com.ht.api.call.func.impl.event;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.ht.api.bean.AjaxResult;
import com.ht.api.bean.LoginBean;
import com.ht.api.call.func.IFunctionCall;
import com.ht.api.db.Db;
import com.ht.api.db.DbList;
import com.ht.api.db.Entity;
import com.ht.api.service.EventService;

/**
 * 事件效果查询
 */
public class EventEffectQueryFunctionCall implements IFunctionCall {

    @Override
    public String getName() {
        return "事件效果查询";
    }

    @Override
    public JSONObject execute(LoginBean me, JSONObject param, AjaxResult result) {

        DbList list = result.getRecords();

        for (Entity entity : list) {
            EventService.formatRelation(me.getDataSource(), entity);
        }

        return null;
    }
}
